<?php include("include/header.php");
?>
<section id="content">
    <section class="hbox stretch">
        <section>
            <section class="vbox">
                <section class="scrollable padder">
                    <div class="m-b-md">
                        <h3 class="m-b-none"></h3>
                    </div> 
                    <ul class="breadcrumb">
                        <li><a ><i class="fa fa-home"></i> 首页</a></li>
                        <li><a><i class="fa fa-list-ul"></i> 标签管理</a></li>
                        <li class="active"> <a href="index.php?c=manage&m=type_list"><i class="fa fa-list-ul"></i> 标签列表</a></li>
                    </ul>
                    <?php if ($_SESSION["user_type"] == 2) { ?>
                    <div class="row m-b-sm">
                        <div class="col-sm-6">
                            <a href="index.php?c=manage&m=type_add" class="btn btn-s-md btn-success">添加标签</a>
                        </div>
                        <div class="col-sm-6">
                            <div class="ksearch">
                                <form class="navbar-left" role="search" method="post" action="index.php?c=manage&m=type_list">
                                    <div class="input-group">
                                        <span class="input-group-btn">
                                            <button type="submit" class="btn btn-sm bg-white b-white btn-icon"><i class="fa fa-search"></i></button>
                                        </span>
                                        <input type="text" class="form-control input-sm no-border" id="keyword" name="keyword" value="<?= $keyword ?>" placeholder="标签名">
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                    <?php } ?>
                    <section class="panel panel-default">
                        <header class="panel-heading">标签管理</header>
                        <form id="form1"  name="form1" method="post" >

                            <table class="table table-striped m-b-none">
                                <thead>
                                    <tr>
                                        <th>序号</th>
                                        <th>标签名称</th>
                                        <th width="80">操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php foreach ($res as $k => $row) { ?>
                                        <tr>
                                            <td><?= $k + 1 ?></td>
                                            <td><?= $row['type_name'] ?></td>
                                            <td class="text-right">
                                                <?php if ($_SESSION['user_type'] == "2") { ?>
                                                 <div class="btn-group">
                                                    <a title="编辑" href="index.php?c=manage&m=type_edit&id=<?= $row['id'] ?>" class="dropdown-toggle"><i class="fa fa-pencil"></i></a>
                                                    <?php if ($_SESSION['user_type'] == "2") { ?>
                                                        <a title="删除标签" onclick="return confirm('是否将此永久删除?')" href="index.php?c=manage&m=type_delete&id=<?= $row['id'] ?>"><i class="i i-cross2"></i></a>
                                                        <?php } ?>
                                                </div>
                                                <?php }?>
                                            </td>
                                        </tr>
                                    <?php } ?>
                                </tbody>
                            </table>
                            </table>
                        </form>
                    </section>
                </section>
            </section>
        </section>
    </section>
</section>
<?php include("include/footer.php"); ?>